package com.jx.jingxuan.widget.autoViewPager;

import android.content.Context;
import android.view.animation.Interpolator;
import android.widget.Scroller;

/**
 *<li>Package: {@link FixedSpeedScroller}
 *<li>Author: cyh
 *<li>Date: 2017/6/23 15:36
 *<li>Discription: 自定义Scroller,替换viewpager的Scroller
 */

public class FixedSpeedScroller extends Scroller {

    private int mDuration = 500; // 默认滑动速度 500

    public FixedSpeedScroller(Context context) {
        super(context);
    }

    public FixedSpeedScroller(Context context, Interpolator interpolator) {
        super(context, interpolator);
    }

    @Override
    public void startScroll(int startX, int startY, int dx, int dy, int duration) {
        super.startScroll(startX, startY, dx, dy, mDuration);
    }

    @Override
    public void startScroll(int startX, int startY, int dx, int dy) {
        super.startScroll(startX, startY, dx, dy, mDuration);
    }

    public void setmDuration(int time) {
        mDuration = time;
    }

    public int getmDuration() {
        return mDuration;
    }
}
